package com.wwtech.epp.ui.activity.friend.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.db.Friend;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.friend.FriendListActivity;
import com.wwtech.epp.ui.activity.friend.contract.FriendListContract;
import com.wwtech.epp.ui.activity.friend.presenter.FriendListPresenter;
import com.wwtech.epp.ui.adapter.main.GroupMemberCheckMangerAdapter;

import java.util.ArrayList;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.friend
 * @Description: The moduele of FriendListActivity, provide field for FriendListActivity
 * @date 2017/09/25 15:56:45
 */
@Module
public class FriendListModule {
    private final FriendListContract.View mView;


    public FriendListModule(FriendListContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public FriendListPresenter provideFriendListPresenter(HttpAPIWrapper httpAPIWrapper, FriendListActivity mActivity) {
        return new FriendListPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public FriendListActivity provideFriendListActivity() {
        return (FriendListActivity) mView;
    }

    @Provides
    @ActivityScope
    public GroupMemberCheckMangerAdapter prvodeGroupMemberCheckMangerAdapter() {
        return new GroupMemberCheckMangerAdapter(new ArrayList<Friend>());
    }
}